import { RouteRecordRaw, RouteMeta } from "vue-router";
import { defineComponent } from 'vue';

declare module 'vue-router' {
  interface RouteMeta {
    title: string,
    alias?: string
    menu?: string
  }
}


export type Component<T = any> =
  | ReturnType<typeof defineComponent>
  | (() => Promise<typeof import('*.vue')>)
  | (() => Promise<T>);


// @ts-ignore
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
  name: string;
  meta: RouteMeta;
  component?: Component | string;
  components?: Component;
  children?: AppRouteRecordRaw[];
  props?: Recordable;
  fullPath?: string;
}

export type AppRouteModule = AppRouteRecordRaw;